package ift605.EquationWithTrainingAgents.struct;

import java.io.Serializable;

import jade.core.AID;
import jade.core.Agent;

public class DerivationStep implements Serializable{
	private static final long serialVersionUID = 1L;
	private AID mAgent;
	private Object mVariation;
	
	public DerivationStep(AID aAgent, Object aVariation){
		mAgent = aAgent;
		mVariation = aVariation;
	}
	
	public AID getAgent(){
		return mAgent;
	}
	
	public Object getVariation(){
		return mVariation;
	}
	
	@Override
	public boolean equals(Object o)
	{
		if(o instanceof Agent){
			Agent a = (Agent)o;
			if(a.getAID().equals(mAgent)){
				return true;
			}
		}
		return false;
	}
	
	@Override
	public int hashCode(){
		return mAgent.hashCode();
	}
	
	@Override
	public String toString()
	{
		return "<" + mAgent.getLocalName() + " || " + ( mVariation == null ? "null" : mVariation.toString()) + ">";
	}
}